<?php

namespace app\common\services;

use yii\helpers\Url;

class UrlService
{

    public static function buildWebUrl($path, $params = [])
    {
        $path = Url::toRoute(array_merge([$path], $params));
        $domains = \Yii::$app->params['domain'];
        return $domains['web'] . $path;
    }

    public static function buildMUrl($path, $params = [])
    {
        $path = Url::toRoute(array_merge([$path], $params));

        $domains = \Yii::$app->params['domain'];
        return $domains['m'] . $path;
    }

    public static function buildWwwUrl($path, $params = [])
    {
        $path = Url::toRoute(array_merge([$path], $params));

        $domains = \Yii::$app->params['domain'];
        return $domains['www'] . $path;
    }

    public static function buildSourceUrl($path, $params = [])
    {
        $domains = \Yii::$app->params['domain'];
        return $domains['source'] . $path;
    }

    public static function buildNullUrl()
    {
        return "javascript:void(0);";
    }

}